package com.me.springsimple.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


@Entity
@Table(name="emp")
public class EmpEntity {
	  /**
	 * 
	 */
	
	private Integer empid;
	private String username;
	private String password;
	private String name;
	private String lname;
	private Integer age;
	private String birthday;
	private Integer workid;
	private WorkingEntity work;
	
	@Id
	@Column(name="empid")
	public Integer getEmpid() {
		return empid;
	}
	public void setEmpid(Integer empid) {
		this.empid = empid;
	}
	
	@Column(name="username")
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	
	@Column(name="password")
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	@Column(name="name")
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name="lname")
	public String getLname() {
		return lname;
	}
	public void setLname(String lname) {
		this.lname = lname;
	}
	
	@Column(name="age")
	public Integer getAge() {
		return age;
	}
	public void setAge(Integer age) {
		this.age = age;
	}
	
	@Column(name="birthday")
	public String getBirthday() {
		return birthday;
	}
	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}
	
	@Column(name="workid")
	public Integer getWorkid() {
		return workid;
	}
	public void setWorkid(Integer workid) {
		this.workid = workid;
	}
	
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="workid" , referencedColumnName="workid",insertable=false,updatable=false)
	public WorkingEntity getWork() {
		return work;
	}
	public void setWork(WorkingEntity work) {
		this.work = work;
	}
	
	
	  
}
